<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>JavaScript</title>
    <script>
        /*
        *   指定
        *
        * */
        var array=new Array('Hello','Hi');
        var count=0;

        window.onload=function () {document.getElementById("div1").addEventListener("click",function (e) {
            //location.go(1)
            //this.style.opacity=0.3;
            var div=document.createElement("div");
            var txt;
            count++
            if (count%2==0){
                txt=document.createTextNode(array[0])
            } else{
                txt=document.createTextNode(array[1])
            }
            div.append(txt);
            div.style.position="absolute";
            div.style.margin=e.clientY+'px 0 0 '+e.clientX+'px';
            this.appendChild(div);

            var c=1;
            var i=setInterval(function () {
                var divlocation=div.style.margin.trim().split("px");
                var y=divlocation[0];
                var x=divlocation[3];
                y=parseInt(y)-5;
                console.log(y);
                div.style.margin=y+"px 0 0 "+x+"px";
                c-=0.05;
                div.style.opacity=c;
            },100);
        },false);  }
        /*var a;
        console.log(a);
        console.log(a==undefined);
        console.log(a==null);*/
    </script>
    <style>
        #div1{
            width: 10000px;
            height: 5000px;
        }
    </style>
</head>
<body>
    <div id="div1"></div>
</body>
</html>